﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ContainerPerformance
{
    class CustomKey : IEquatable<CustomKey>
    {
        public Guid ID { get; private set; }
        public long Number { get; private set; }

        public CustomKey( Guid id, long number )
        {
            ID = id;
            Number = number;
        }

        override public int GetHashCode()
        {
            return ID.GetHashCode() ^ Number.GetHashCode();
        }

        public bool Equals(CustomKey obj )
        {
            return ID.Equals(obj.ID) && obj.Number == Number;
        }

       
    }

    class CustomKeyComparer : IEqualityComparer<CustomKey>
    {
        public int GetHashCode(CustomKey key)
        {
            return key.ID.GetHashCode() ^ key.Number.GetHashCode();
        }

        public bool Equals(CustomKey key1, CustomKey key2)
        {
            return key1.ID.Equals(key2.ID) && key1.Number == key2.Number;
        }
    }
}
